package rongyao;

import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/8/20
 * @project AutumnOffer
 * @description
 **/
public class Test1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.next();
        for(int i=0;i<n;i++){
            if(str.charAt(i*9)=='0'){
                for(int init = (i+1)*9-1;init>i*9;init--){
                    System.out.print(str.charAt(init));
                }
                System.out.print(" ");
            }else{
                for(int init=i*9+1;init<(i+1)*9;init++){
                    System.out.print(str.charAt(init));
                }
            }
        }
    }
}
